/**
 * Created by WU on 2016/9/22.
 */
var DBPool=require('../util/DBpool');
module.exports= {
    get_shop:function (callback){
            sql1='select userno,useraddress,pic,image,shop_name from t_image,t_userinfo where objID=userno && imageobj=usertype';
            DBPool.getConnection(function (client) {
                client.query(sql1,function (error,result) {
                    if(error){
                        console.log(error.message);
                        return;
                    }
                    callback(result);
                    client.release();

                });
            });
    },
    get_shop_details:function(index,callback){
        var sql='select * from t_shopinfo where userno=? order by imageno limit 0,1';
        DBPool.getConnection(function (client) {
            client.query(sql,[index],function (error,result) {
                if(error){
                    console.log(error.message);
                    return;
                }
                callback(result);
                client.release();

            });
        });
    }



};
